#include "stack.h"
#include <iostream>
#include <tuple>

#define BINARY 2
#define OCTONARY 8
#define DECIMAL 10
#define HEXADECIMAL 16

using namespace std;

int main()
{
    Stack<int> *s = new Stack<int>(32);
    int bases[] = {BINARY, OCTONARY, DECIMAL, HEXADECIMAL};
    for (int base : bases)
    {
        int num = 1348;
        int rest = 0;
        while (num != 0)
        {
            rest = num % base;
            s->Push(rest);
            num /= base;
        }
        bool success;
        int element;
        while (tie(success, element) = s->Pop(), success)
        {
            cout << element;
        }
        cout << endl;
    }
    delete s;
    return 0;
}
